<?
include('../controller/twitter.php');
include('../controller/handler.php');

$hd = new Handler();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link rel="alternate" type="application/rss+xml" href="<?echo $base_url;?>rss/twitwords" />
	<?
	/****************
	 * HEAD MODULE
	 ***************/
	include('../module/head.inc.php');
	?>

	<title><?echo $hd->getTitle();?> - Test</title>
</head>

<body>
<?
/****************
 * HEADER MODULE
 ***************/
include('../module/header.inc.php');
?>
<div id="container">
	
<?php
$page = 1;
//$api = new Twitter($hd->getTwitterUser(), $hd->getTwitterPassword());
//echo $api->getReplies("xml", $page, (int)$hd->getLastStatus());

//$link = "http://twitter.com/statuses/replies.xml";
$link = "http://twitter.com/statuses/public_timeline.xml";

$http_response = "";
$url = parse_url($link);
$fp = fsockopen($url[host], 80);
fputs($fp, "GET /$url[path]?$url[query] HTTP/1.0\n");
//fputs($fp, "Authorization: Basic ".base64_encode("twitwords:3r3t1c0"));
fputs($fp, "Connection: close\n\n");
$http_response = stream_get_contents($fp);
fclose($fp);

echo $http_response;

?>
	
	<div id="credits"><?echo $hd->getCredits();?></div>
</div>


<div id="footer">TEST PAGE</div>

<?include('../module/analytics.inc.php');?>
</body>
</html>
